home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2953 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.2 KB

  1. Path: prairienet.org!sjmccaug
  2. From: sjmccaug@prairienet.org (Scott J. McCaughrin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: memory model question
  5. Date: 20 Jan 1996 22:17:40 GMT
  6. Organization: University of Illinois at Urbana
  7. Message-ID: <4drpm4$f6s@vixen.cso.uiuc.edu>
  8. References: <4d94go$sp0@cantaloupe.srv.cs.cmu.edu>
  9. Reply-To: sjmccaug@prairienet.org (Scott J. McCaughrin)
  10. NNTP-Posting-Host: firefly.prairienet.org
  11.  
  12.  
  13. In a previous article, bmm+@BMM.PC.CS.CMU.EDU (Bruce Maggs) says:
  14.  
  15. >
  16. >Hi,
  17. >
  18. >I'm compiling a C program using Borland's C++ for DOS.  It's a large
  19. >program, but doesn't use much static memory.  I've selected the
  20. >"small" memory model.  The program compiles and runs without any
  21. >problems, but the length of the .exe file that the compiler produces
  22. >is 148K.  I thought that in the small memory model the length of the
  23. >code would be limited to one segment, i.e., 64K.  I'm curious about
  24. >what's going on here.  Does the compiler automatically split my code
  25. >into two or more segments?
  26. >
  27.  The small model actually supports 2 segments -- one for code, the other
  28.  for everything else. Then, there is extra stuff for relocation to make
  29.  a .exe file. It is the tiny model that confines code and data to one
  30.  segment.
  31.  
  32.  Scott
  33.  
  34.